﻿<%@ Page Language="C#" EnableViewState="false" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="Forum.Web.Admin.Company.GK.Add" %>
<%@ Register assembly="Editor2" namespace="Editor2" tagprefix="cc1" %>
<%@ Register assembly="Public.Control" namespace="Public.Control" tagprefix="cc11" %>

<html>
<head id="Head1" runat="server">
    <title></title>
    <link href="../../styles/dntmanager.css" rel="stylesheet" type="text/css" />
    <link href="../../styles/modelpopup.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.list_tu {
	height: 120px;
	width: 120px;
	float: left;
	display: block;
	margin-right: 15px;
	margin-top: 15px;
	border: 1px solid #729FD8;
}
.apDiv1 {
	position:static;
	height:20px;
	z-index:1;
	margin-top: -20px;
}
.apDiv1 div {
	background-color: #B3CBEA;
	height: 20px;
	text-align: center;
	line-height: 20px;
	cursor:pointer;
	float: left;
	width: 120px;
}
#jiatu_ {
	float: left;
	margin-top: 15px;
	padding-top: 60px;
}
#jiatu_ img {
	cursor:pointer;
}
.list_tu img {
	height: 100px;
	width: 120px;
}
.list_tu div {
	background-color: #FFFFFF;
	line-height: 20px;
	height: 20px;
	width: 120px;
}
.list_tu span {
	cursor:pointer;
}
.list_tu span:hover {
	color: #FF0000;
}
</style>
</head>
<script src="../../js/common.js" type="text/javascript"></script>
<script src="../../js/modalpopup.js" type="text/javascript"></script>
<script src="../../js/public.js" type="text/javascript"></script>
<body  class="ContentBody">
<form id="form2" runat="server">
<asp:TextBox ID="TextBox1" runat="server" Width="672px" style=" display:none;"></asp:TextBox>
    <cc11:Hint ID="Hint1" runat="server" HintImageUrl="../../images" />
    	<div class="ManagerForm">
		<fieldset>
		    <legend style="background:url(../../images/icons/icon30.jpg) no-repeat 6px 50%;">添加/修改公司概况</legend>
<div class="MainDiv">
<table width="100%" border="0" cellpadding="0" cellspacing="0" 
                             style="width: 100%; padding-right: 5px;">
                             <tr>
                                 <td width="100" height="40" align="right" style="padding-right: 5px">
                                     标题:</td>
                               <td>
                                   &nbsp;<cc11:TextBox ID="f_name"   HintInfo="公司简介,领导致辞,组织结构,公司荣誉,企业文化..." 
                                       runat="server" Width="210px" HintShowType="down" ></cc11:TextBox>
                               <span style="display:none;"><input id="Text2" style="width: 12px" type="text" /></span></td>
        </tr>
                             <tr>
                                 <td height="40" align="right">描述:</td>
                         <td height="50" style="padding:5px">
                       <cc11:TextBox 
                                          ID="f_shuoming" HintInfo="对主内容的简短说明,120个汉字以内" runat="server" 
                                   Width="400px" Height="80px" 
                                          TextMode="MultiLine"></cc11:TextBox>                               </td>
        </tr>
                             <tr  id="yc_0">
                                 <td height="40" align="right">内容:</td>
                           <td height="50" style="padding:5px">
                   <cc1:HtmlEditor ID="HtmlEditor1" runat="server" Width="600px" 
                                   ResourcesPath="/htmledit/">                             </cc1:HtmlEditor>                                                    </td>
        </tr>
                             <tr>
                                 <td height="40" align="right">首页缩略图:</td>
                               <td height="50">
 &nbsp;
<cc11:TextBox ID="f_tu"  HintInfo="可为网络地址,如:http://www.jingdiansheji.com/logo.gif" runat="server" 
                                       Width="220" HintShowType="up"></cc11:TextBox>
                                                <cc11:Button 
                                       ID="Button3" runat="server" AutoPostBack="False" 
                                       ButtonImgUrl="../../images/arrow_undo.gif" Text=" 浏 览" ValidateForm="False" 
                                       ScriptContent="up1_onclick()" />&nbsp;</td>
        </tr>
                             </table>
<script  type="text/javascript">
function Button1_onclick() {
    return jc();
}
function jc()
{
    if(hbctl_.$("f_name").value.length<1)
    {
        alert("请输入文章标题");
        return false;
    }
    onsub_();
}

function onsub_()
{
    var f_name=hbctl_.$("f_name").value;//标题
    var f_tu=hbctl_.$("f_tu").value;//图片
    var f_shuoming=hbctl_.$("f_shuoming").value;//说明
    var rbody=RIfrBodyHtml();//内容
    
    var rid=hbctl_.Request("id");
    if(rid=="")
    {
         Forum.Web.Admin.Company.GK.Add.AddData( f_name,f_tu,rbody,f_shuoming,rshow);
    }
    else
    {
         Forum.Web.Admin.Company.GK.Add.Editata(rid,  f_name,f_tu,rbody,f_shuoming,rshow);
    }
}
function rshow(res)
{
    if(res)
    {
        var msg=window.confirm("操作成功!是否添加新信息?");
        if(msg)
        {
            window.location="Add.aspx";
        }
        else
        {
            var uurl= hbctl_.$('TextBox1').value.toLocaleLowerCase();

            if(uurl.indexOf('list.aspx')!=-1)
            {
                window.location=uurl;
            }
            else
            {
                window.location="List.aspx";
            }
        }
    }
    else
    {
        alert("操作失败!请刷新页面重新操作");
        window.location="Add.aspx";
    }
}
function up1_onclick() {
   var restu=tu_();
   if(restu!=null)
   {
		hbctl_.$('f_tu').value=restu;
   }
}
function tu_() {
	var galleryscript = '../../IfrUpAspx/Ifr.aspx?url=UpPic.aspx?path=DownLoad/&yymmdd=false';
	var imgArr = showModalDialog(galleryscript,window,'dialogWidth:350px; dialogHeight:180px;help: no; scroll: no; status: no');
	return imgArr;
}
</script>
<script  type="text/javascript">
function shefm(src_)
{
	hbctl_.$("f_tu").value=src_;
}

var thisurl=window.location.toString().toLowerCase().replace("<%=thisurl %>".toLowerCase(),"");

function addimgs()
{
	imgArr = tu_();
	if (imgArr != null) {
        var oRTE = frames.message;
        try{
            oRTE.focus();
            var oRng = oRTE.document.selection.createRange();
            if(imgArr.indexOf('http://')==-1)
            {
                oRng.pasteHTML("<img src='"+thisurl+"/"+imgArr+"'/>");
            }
            else
            {
                oRng.pasteHTML("<img src='"+imgArr+"'/>");
            }
            oRng.collapse(false);
            oRng.select();
        }
        catch(e){}
	}
}
</script>
</div>
		</fieldset>
        <div class="Navbutton">
<span id='sp3'><cc11:Button 
                                       ID="Button4" runat="server" AutoPostBack="False" 
                                       ButtonImgUrl="../../images/check_1.gif" 
                Text=" 保存内容" ValidateForm="False" 
                                       ScriptContent="return Button1_onclick()" /></span>
                                       
<span id='sp5'>&nbsp;
            <cc11:Button 
                                       ID="Button6" runat="server" AutoPostBack="False" 
                                       ButtonImgUrl="../../images/cache_reset.gif" 
                Text=" 取  消" ValidateForm="False" 
                                       ScriptContent="history.go(-1);" /></span>
                                       
        </div>
        </div>
    </form>
</body>
</html>